package com.example.service;

import com.example.dao.IndentDao;
import com.example.entity.indent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class IndentServiceImpl implements IndentService {
      private IndentDao indentDao;

      @Autowired
      public IndentServiceImpl(IndentDao indentDao) {
            this.indentDao = indentDao;
      }

      @Override
      public void addOrder(indent indent) {
            indentDao.addOrder(indent);
      }

      @Override
      public List<indent> findUserIndent(String userId) {
            return indentDao.findUserIndent(userId);
      }

      @Override
      public void payOrder(Integer num) {
            indentDao.payOrder(num);
      }

      @Override
      public List<indent> findAllIndent() {
            return indentDao.findAllIndent();
      }

      @Override
      public List<indent> findMerchantIndent(String merchantId) {
            return indentDao.findMerchantIndent(merchantId);
      }
}
